using UnityEngine;
using System.Collections;

public class BombMove : MonoBehaviour {
	
	public int moveSpeed;
	Vector3 bombDirection = Vector3.left;
	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		if(Difficulty.difficulty == 1) moveSpeed = 100;
		else if(Difficulty.difficulty == 2) moveSpeed = 130;
		else moveSpeed = 180;
		
		Vector3 newPosition = Vector3.zero;
		newPosition = bombDirection * (moveSpeed * Time.deltaTime);
		
		newPosition = newPosition + transform.position;
				
		transform.position = newPosition;
		
		if(newPosition.x < -150)
		{
			Destroy(transform.gameObject);
			Score.lives --;
			
			
		}
	
	}
	
	void OnCollisionEnter()
	{
		Score.score += 5 * Difficulty.difficulty * PaddleMove.bucket;
		                                            
		Score.tempScore += 5 * Difficulty.difficulty * PaddleMove.bucket;
		Destroy(transform.gameObject);
	}
}
